package action;

import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.Turma;

public class IncluirTurmaAction extends ManterTurmaAction {
    @Override
    public void setParametros(HttpServletRequest request, HttpServletResponse response) throws ServletException {
        request.setAttribute("editar", "");
        request.setAttribute("excluir", "");
    }

    @Override
    public void efetuaPersistencia(Turma turma) throws ServletException {
        try {
            turma.gravar();
        } catch (SQLException e) {
            throw new ServletException(e);
        } catch (ClassNotFoundException e) {
            throw new ServletException(e);
        }
    }

}
